package com.orange.framework.init;

import com.orange.common.utils.IpUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Component
@Order(999)
public class OrangeApplicationRunner implements ApplicationRunner {

    private final static Logger logger = LoggerFactory.getLogger(OrangeApplicationRunner.class);

    @Value("${server.port}")
    private int port;

    @Override
    public void run(ApplicationArguments args) throws Exception {

        logger.info("程序部署完成，访问地址：{}:{}", IpUtil.getLocalHostIP(), port);
    }
}